home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 15294 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: anchor.gsfc.nasa.gov!jyli
  2. From: "Jason Y. Li" <jyli@anchor.gsfc.nasa.gov>
  3. Newsgroups: comp.lang.c
  4. Subject: [Q] unpack 10 bit data
  5. Date: Wed, 17 Apr 1996 23:19:10 -0400
  6. Organization: NASA Goddard Space Flight Center -- Greenbelt, Maryland USA
  7. Message-ID: <Pine.SGI.3.91.960417231151.16763A-100000@anchor.gsfc.nasa.gov>
  8. NNTP-Posting-Host: anchor.gsfc.nasa.gov
  9. Mime-Version: 1.0
  10. Content-Type: TEXT/PLAIN; charset=US-ASCII
  11.  
  12.  
  13. I am looking for an efficient and elegant way of unpacking 10 bit data. 
  14. In many scientific applications, raw data are packed into 10 bit data 
  15. stream.  For example, an input buffer of 40 bits (5 characters) contains 
  16. four 10-bit integers.  I know one way of unpacking the data which involves 
  17. bit masking and then shifting left-and-right. It looks pretty messy to me. I 
  18. am sure smart folks out there have better ways or ideas. I'd appreciate 
  19. if you would let me know.
  20.  
  21. Thanks in advance 
  22.  
  23.  
  24. ========================================================================
  25. Jason Y. Li                       | Tel :  (301) 286-1029
  26. Code 913                          | Fax :  (301) 286-1759 
  27. NASA Goddard Space Flight Center  | www :  http://climate.gsfc.nasa.gov
  28. Greenbelt, MD 20771, USA          | email: jyli@climate.gsfc.nasa.gov
  29. ========================================================================
  30.   Beauty of style, harmony, grace and good rhythm depend on simplicity.
  31.  
  32.  
  33.